<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<script src="../JavaScript/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加化妆品信息</title>
</head>
<body>
 <div>
 <form id="form">
 <table>
 <tr><th><h1>添加化妆品信息</h1></th></tr>
 <tr><td>化妆品名称</td><td><input type="text" name="cosmeticName"/></td></tr>
 <tr><td>化妆品价格</td><td><input type="text" name="cosmeticPrice"/></td></tr>
 <tr><td>生产厂家</td><td><input type="text" name="manufacturer"/></td></tr>
 <tr><td>出厂日期</td><td><input type="text" name="makeTime"/></td></tr>
 <tr><td><input type="button" value="添加" id="addcos"/></td>
 	 <td><input type="reset" value="重置" id="reset"/></td>
 </tr>
 </table>
 </form>
 </div>
 <script type="text/javascript">
 	$("#addcos").click(function () {
 		$.ajax({
 			type:"post",
 			url:"addCos",
 			data:$("#form").serialize(),
 			success:function(data){
 		alert("ajax");
 				if(data.flag){
 					alert("添加成功");
 					$("#reset").click();
 				}
 			}
 		});
 	});
 </script>
</body>

</html>